package cn.gcyl.module.biz.dal.mysql.projectprocurementinformation;

import java.util.*;

import cn.gcyl.framework.common.pojo.PageResult;
import cn.gcyl.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.gcyl.framework.mybatis.core.mapper.BaseMapperX;
import cn.gcyl.module.biz.dal.dataobject.projectprocurementinformation.ProjectProcurementInformationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.gcyl.module.biz.controller.admin.projectprocurementinformation.vo.*;

/**
 * 项目采购信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ProjectProcurementInformationMapper extends BaseMapperX<ProjectProcurementInformationDO> {

    default PageResult<ProjectProcurementInformationDO> selectPage(ProjectProcurementInformationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProjectProcurementInformationDO>()
                .eqIfPresent(ProjectProcurementInformationDO::getTitleType, reqVO.getTitleType())
                .eqIfPresent(ProjectProcurementInformationDO::getTitle, reqVO.getTitle())
                .eqIfPresent(ProjectProcurementInformationDO::getIndustry, reqVO.getIndustry())
                .eqIfPresent(ProjectProcurementInformationDO::getArea, reqVO.getArea())
                .betweenIfPresent(ProjectProcurementInformationDO::getPublicationTime, reqVO.getPublicationTime())
                .eqIfPresent(ProjectProcurementInformationDO::getDetails, reqVO.getDetails())
                .betweenIfPresent(ProjectProcurementInformationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ProjectProcurementInformationDO::getId));
    }

}